from django.urls import path
from rest_framework_jwt.views import obtain_jwt_token

from apps.meiduo_admin.login import admin_jwt_token_view
from apps.meiduo_admin.views.home import UserDailyActiveCountView, UserDailyOrderCountView, UserMonthCountView, \
    UserdayincrementView, UsertotalcountView
from apps.meiduo_admin.views.image import SKUImageView, SKUListAPIView
from apps.meiduo_admin.views.user import UserListView

urlpatterns = [

    path('authorizations/', obtain_jwt_token),
    path('authorizations/', admin_jwt_token_view),
    path('statistical/day_active/', UserDailyActiveCountView.as_view()),
    path('statistical/day_orders/', UserDailyOrderCountView.as_view()),
    path('statistical/month_increment/', UserMonthCountView.as_view()),
    path('statistical/day_increment/', UserdayincrementView.as_view()),
    path('statistical/total_count/', UsertotalcountView.as_view()),
    path('users/', UserListView.as_view()),
    path('skus/simple/', SKUListAPIView.as_view()),
]

# 添加视图集的路由
from rest_framework import routers

router = routers.DefaultRouter()

router.register('skus/images', SKUImageView, basename='images')
# 把路由信息 合并过来
urlpatterns += router.urls

print(urlpatterns)
